<div>
    <div style="margin-bottom: 16px">
        showLine: <Switch @bind-Checked="_showLine" />
        <br />
        <br />
        showIcon: <Switch @bind-Checked="_showIcon" />
        <br />
        <br />
        showLeafIcon: <Switch @bind-Checked="_showLeafIcon" />
    </div>

    <Tree 
    ShowLine="@_showLine" 
    ShowIcon="@_showIcon"
    ShowLeafIcon="@_showLeafIcon"
    DefaultExpandedKeys="@(new[]{"0-0-0"})"
    OnSelect="OnSelect"
    TItem="string">
        <Nodes>
            <TreeNode Title="parent 1" Key="0-0" Icon="carry-out" TItem="string">
                <Nodes>
                    <TreeNode Title="parent 1-0" Key="0-0-0" Icon="carry-out" TItem="string">
                        <Nodes>
                            <TreeNode Title="leaf" Key="0-0-0-0" Icon="carry-out" TItem="string" />
                            <TreeNode Key="0-0-0-1" Icon="carry-out" TItem="string">
                                <TitleTemplate>
                                    <div>
                                        <div>multiple line title</div>
                                        <div>multiple line title</div>
                                    </div>
                                </TitleTemplate>
                            </TreeNode>
                            <TreeNode Title="leaf" Key="0-0-0-2" Icon="carry-out" TItem="string" />
                        </Nodes>
                    </TreeNode>
                    <TreeNode Title="parent 1-1" Key="0-0-1" Icon="carry-out" TItem="string">
                        <Nodes>
                            <TreeNode Title="left" Key="0-0-1-0" Icon="carry-out" TItem="string" />
                        </Nodes>
                    </TreeNode>
                    <TreeNode Title="parent 1-2" Key="0-0-2" Icon="carry-out" TItem="string">
                        <Nodes>
                            <TreeNode Title="leaf" Key="0-0-2-0" Icon="carry-out" TItem="string" />
                            <TreeNode Title="leaf" Key="0-0-2-1" Icon="carry-out" TItem="string" SwitcherIcon="form" />
                        </Nodes>
                    </TreeNode>
                </Nodes>
            </TreeNode>
            <TreeNode Title="parent 2" Key="0-1" Icon="carry-out" TItem="string">
                <Nodes>
                    <TreeNode Title="parent 2-0" Key="0-1-0" Icon="carry-out" TItem="string">
                        <Nodes>
                            <TreeNode Title="leaf" Key="0-1-0-0" Icon="carry-out" TItem="string" />
                            <TreeNode Title="leaf" Key="0-1-0-1" Icon="carry-out" TItem="string" />
                        </Nodes>
                    </TreeNode>
                </Nodes>
            </TreeNode>
        </Nodes>
    </Tree>
</div>

@code {
    bool _showLine = true;
    bool _showIcon = false;
    bool _showLeafIcon = true;

    void OnSelect(TreeEventArgs<string> e)
    {
        Console.WriteLine(JsonSerializer.Serialize(e));
    }
}


